home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
ocx
/
maze
/
defined.txt
next >
Wrap
Text File
|
1996-03-05
|
3KB
|
79 lines
Maze.OCX - Copyright 1996 Caffeinated Software
Version 1.00b
03/05/96
========================================================================
Here's a short description of the constants, properties and methods
that are used in the Maze.OCX. You must declare the constants somewhere
in your code in order to use them. If you have any problems, please
feel free to e-mail me at kim@interport.net.
Constants
------------------------------------------------------------------------
const mazeTop = &H0001
const mazeBottom = &H0002
const mazeRight = &H0004
const mazeLeft = &H0008
const dirUp = 0
const dirDown = 1
const dirLeft = 2
const dirRight = 3
Properties
------------------------------------------------------------------------
PlayerName
Text used to specify a player name
MazeRows
Total number of rows in maze
MazeCols
Total number of columns in maze
Methods
------------------------------------------------------------------------
NewPlayer()
Adds a new player to the control. Uses PlayerName (if no player
name specified, it will set it to "default"). Returns the player ID.
RemovePlayer(ID as integer)
Removes the player specified by ID. Returns true or false depending
upon success.
DefineWall(Row as integer, Col as integer, mFlags as integer)
Defines a wall at the location specified by Row and Col. mFlags is
a value represented by mazeTop, mazeBottom, mazeLeft, and mazeRight
constants. For instance, if you want a wall on the top and the left
sides of the grid cell, you would use mFlags = mazeTop AND mazeLeft.
GetWall(Row as integer, Col as integer)
Gets the value of the walls for the grid cell specified by Row and
Col. For instance, for a top and bottom wall, the value would be 3
(mazeTop AND mazeBottom = 3). To get individual values OR the result.
Example: isTop = GetWall(0, 0) OR mazeTop
PlayerMoveUp(ID as integer)
Moves the player (specified by ID) up a row in the maze. If
successful, returns True. If player can't move up due to wall or
edge, returns False.
PlayerMoveDown, PlayerMoveLeft, PlayerMoveRight
Same as above
PlayerMove(ID as integer, Direction as integer)
Moves the specified player in the specified direction one cell.
Direction is one of the 4 values described above.
GetPlayerX(ID as integer)
Returns the specified player's X location in the grid.
GetPlayerY(ID as integer)
Returns the specified player's Y location in the grid.
SetPlayerScore(ID as integer, Score as integer)
Sets the specified player's score to the specified value.
GetPlayerScore(ID as integer)
Returns the specified player's score.
SetObstacle(Row as integer, Col as integer, Type as integer)
Sets an obstacle at the specified location in the grid. Type
is the type of the obstacle. It has no significance; it's merely
a data item for your use.
GetObstacle(Row as integer, Col as integer)
Returns the type of obstacle at the given row and column. Returns
-1 if there is no obstacle at that location.
Note: A player can be at the same location as an obstacle.
SetPlayerLocation(ID as integer, Row as integer, Col as integer)
Moves the specified player to the specified cell in the grid if
possible. Returns True if successful, False if not.